// part1:C10:ex10.2.cpp
// read elements of string, store them to list.
#include <iostream>
#include <fstream>
#include <string>
#include <list>
#include <algorithm>
using namespace std;

int main(int argc, char *argv[]) {
  ifstream in(argv[1]);
  if (!in) {
    cout << "failed to open input file!" << endl;
    exit(1);
  }

  list<string> ilis;
  string word;
  while (in >> word) {
    ilis.push_back(word);
  }
  cout << "Enter your find characters:\n";
  cin >> word;

  cout << "sequence include : " << count(ilis.begin(), ilis.end(), word)
    << " " << word;
  
  return 0;
}

